<template>
  <div class="header-options">
    <div class="options-header">
      <div class="tabs">
        <div class="tab-item active">{{ title }}</div>
      </div>
      <div class="options-content">
        <el-form :model="value" size="mini" label-width="120px">
          <el-form-item label="背景图片（上）">
            <imageUpload v-model="value.bgImg.top" :limit="1" value-type="json" />
          </el-form-item>
          <el-form-item label="背景图片（下）">
            <imageUpload v-model="value.bgImg.bottom" :limit="1" value-type="json" />
          </el-form-item>
          <el-table :data="value.hints" border style="margin-bottom: 15px;">
            <el-table-column label="图标" align="center" width="100">
              <template slot-scope="{row}">
                <imageUpload v-model="row.icon" :limit="1" value-type="json" />
              </template>
            </el-table-column>
            <el-table-column label="文字" align="center">
              <template slot-scope="{row}">
                <el-input v-model="row.text" />
              </template>
            </el-table-column>
          </el-table>
          <el-form-item label="显示搜索框">
            <el-radio v-model="value.search.show" :label="true">是</el-radio>
            <el-radio v-model="value.search.show" :label="false">否</el-radio>
          </el-form-item>
          <el-form-item label="搜索框提示文字">
            <el-input v-model="value.search.placeholder" />
          </el-form-item>
          <el-form-item label="是否显示轮播图">
            <el-radio v-model="value.swiper.show" :label="true">是</el-radio>
            <el-radio v-model="value.swiper.show" :label="false">否</el-radio>
          </el-form-item>
          <el-form-item label="轮播图样式">
            <el-radio v-model="value.swiper.showStyle" label="12px 20px 0px">卡片式</el-radio>
            <el-radio v-model="value.swiper.showStyle" label="0px">通栏显示</el-radio>
          </el-form-item>
          <el-form-item label="轮播图显示">
            <el-radio v-model="value.swiper.imgStyle" label="100% 100%">拉伸</el-radio>
            <el-radio v-model="value.swiper.imgStyle" label="cover">填充</el-radio>
          </el-form-item>
        </el-form>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  name: 'HeaderOptions',
  props: {
    title: {
      type: String,
      default: ''
    },
    value: {
      type: Object,
      default: null
    }
  }
}
</script>
<style lang="scss" scoped>
::v-deep .el-upload--picture-card{
  width: auto;
  height: auto;
  line-height: 1;
}
::v-deep .el-upload__tip{
  display: none;
}
::v-deep .el-upload-list--picture-card .el-upload-list__item{
  width: auto;
  height: auto;
  line-height: 1;
  margin: 0;
}
</style>
